<!DOCTYPE html><html lang="zh-CN"><head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>taiwan | Moment.js &#x6587;&#x6863;</title>
  <link rel="stylesheet" href="static/css/style.css">
  <link rel="shortcut icon" href="http://momentjs.cn/static/img/moment-favicon.png">
  <link rel="stylesheet" href="static/css/atom-one-light.min.css">
</head>
<body class="is-moment">
  <div class="hero hero-oneline">
    <div class="hero-centered">
      <h1>taiwan</h1>
    </div>
  </div>
  <div id="api-section-__FILENAME__">
    <div id="content" class="clearfix">
  
      <div id="column1" data-id="__ID__" class="interior">
        <header>
          <!-- <h1>taiwan</h1> -->
          <div id="gtoc">
            <ul>
              <!-- <li>v</li> -->
              <li>
                <a href="index.html#/plugins/taiwan/" name="toc">&#x8FD4;&#x56DE;&#x4E0A;&#x5C42;&#x6587;&#x6863;</a>
              </li>
              <li style="border: none;">
                <a href="javascript:window.open('https://github.com/momentjscn/moment-docs-cn/edit/master/moment/10-plugins/17-taiwan.md');" rel="nofollow" target="_blank">&#x63D0;&#x4EA4;&#x4FEE;&#x6539;</a>
              </li>
              <!-- <li>
                <a href="/search__SEARCH_PARAM__" name="toc">搜索</a>
              </li> -->
            </ul>
          </div>
          <hr>
        </header>

        <div id="biz_item"></div>
  
        <div id="apicontent">
          <div id="content_left">
							<div class="docs-method-signature">
								<pre><code class="language-js">npm install moment-taiwan
</code></pre>

							</div>
<p>&#x5982;&#x679C;&#x8981;&#x4F7F;&#x7528;&#x53F0;&#x6E7E;&#x65E5;&#x5386;&#x7CFB;&#x7EDF;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; Bradwoo8621 &#x7684;&#x63D2;&#x4EF6; <code>moment-taiwan</code>&#x3002;</p>
<p>&#x5F53;&#x5B89;&#x88C5;&#x540E;&#xFF0C;&#x5B83;&#x5C06;&#x4F1A;&#x53EF;&#x4EE5;&#x5C01;&#x88C5; <code>moment</code>&#xFF0C;&#x4E14;&#x5C06;&#x53EF;&#x4EE5;&#x683C;&#x5F0F;&#x5316;&#x548C;&#x89E3;&#x6790;&#x53F0;&#x6E7E;&#x5E74;&#x4EFD;&#x3002;
&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x7B80;&#x77ED;&#x7684;&#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code class="language-js">m = moment(&apos;104/01/01&apos;, &apos;tYY/MM/DD&apos;) // &#x89E3;&#x6790; Taiwan &#x65E5;&#x671F;
m.format(&apos;tYY/MM/DD [is] YYYY/M/D&apos;) // 104/01/01 is 2015/01/01

m.twYear() // 104
</code></pre>
<p>&#x8BE5;&#x4ED3;&#x5E93;&#x4F4D;&#x4E8E; <a href="javascript:window.open('http://nodejs.cn/s/V8uhkQ');" target="_blank" rel="nofollow">github.com/bradwoo8621/moment-taiwan</a>&#x3002;</p>
					</div>
          <div id="content_right">
							<div class="docs-method-signature">
								<pre><code class="language-js">npm install moment-taiwan
</code></pre>

							</div>
<p>If you want to work with Taiwan calendar system , you can use Bradwoo8621&apos;s plugin <code>moment-taiwan</code>.</p>
<p>When installed, it will wrap <code>moment</code> and moment will be able to format and parse Taiwan years. Here is a short example:</p>
<pre><code class="language-js">m = moment(&apos;104/01/01&apos;, &apos;tYY/MM/DD&apos;) // Parse a Taiwan date
m.format(&apos;tYY/MM/DD [is] YYYY/M/D&apos;) // 104/01/01 is 2015/01/01

m.twYear() // 104
</code></pre>
<p>The repository is located at <a href="javascript:window.open('https://github.com/bradwoo8621/moment-taiwan');" target="_blank" rel="nofollow">github.com/bradwoo8621/moment-taiwan</a>.</p>
					</div>
          <div></div>
        </div>
      </div>
    </div>
  </div>
  
  <script src="static/js/highlight.min.js"></script>
  <script src="static/js/javascript.min.js"></script>
  <script>hljs.initHighlightingOnLoad();</script>
  <script>var _hmt = _hmt || []; (function () { var hm = document.createElement("script"); hm.src = "//hm.baidu.com/hm.js?7a7f78c805fbacc7e075d34f153031aa"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })();</script>

  <style>
    .hero-centered {
      margin: 0;
          margin-left: 10px;
    }
#gtoc ul {
  list-style: none;
  margin-left: 0;
  line-height: 1.5rem;
  padding: 0;
}
#gtoc>ul>li {
  display: inline;
  border-right: 1px solid #000;
  margin-right: .4rem;
  padding-right: .4rem;
}
#gtoc>ul>li>a {
  color: #61b2a7;
}
#content_left {
  width: 49%;float: left;border-right: 1px solid #eee;    padding-right: 2%;
}
#content_right {
float: left;width: 48%;margin-left: 3%;
}
#column1 {
  padding: 0 2rem;
}
  </style>


</body></html>